﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace System.Collections.Observable.Transaction
{
    /// <summary>
    /// CollectionChangedTransaction represents a handle for transaction
    /// that is being run by implementer of ICollectionChangedTransaction.
    /// </summary>
    public class CollectionChangedTransaction: IDisposable
    {
        public CollectionChangedTransaction(ICollectionChangedTransaction transactionTarget)
        {
            m_transactionTarget = transactionTarget;
        }

        ICollectionChangedTransaction m_transactionTarget;
        public ICollectionChangedTransaction TransactionTarget 
        {
            get
            {
                return m_transactionTarget;
            }
        }

        public void Dispose()
        {
            m_transactionTarget.EndTransaction(this);            
        }
    }
}
